﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using DongleManage.Model.BaseClass;
using System.Data;

namespace  DongleManage.Model.EssentialData
{

		
	/// <summary>
	///  有氧运动
	/// </summary>
	/// <remarks>
	/// 该实体由工具生成，尽量不要手动修改
	/// </remarks>
	[DataContract]
    public partial class AerobicEntity : BaseEntity
	{
		#region 属性、变量声明
		#region 主属性 --对应数据表主键
		/// <summary>			
		/// 编码 
		/// </summary>
		/// <remarks>表Aerobic主键</remarks>
		[DisplayName("编码")]
		[DataMember]
		public Int32 Code
        {
            get;
            set;
        }
		#endregion
		
		#region 属性
		
		/// <summary>
		/// Name : 
		/// </summary>
        [DisplayName("动作名称")]
        [Required(ErrorMessage = "不允许为空!")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String Name
        {
            get;
            set;
        }
		
		/// <summary>
		/// 速度是否输入
		/// </summary>
        [DisplayName("速度是否输入")]
        [Required(ErrorMessage = "1:输入 0:不输入不允许为空!")]
        
		[DataMember]
		public Int32 Speed
        {
            get;
            set;
        }
		
		/// <summary>
		///单位编码 
		/// </summary>
        [DisplayName("单位编码")]
        
		[DataMember]
		public Int32? UnitCode
        {
            get;
            set;
        }
		
		/// <summary>
		/// 单位名称 
		/// </summary>
        [DisplayName("单位名称")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String UnitName
        {
            get;
            set;
        }
		
		/// <summary>
		/// 单位英文名称 
		/// </summary>
        [DisplayName("单位英文名称")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String UnitEName
        {
            get;
            set;
        }
		
		/// <summary>
        /// 功率是否输入1:输入 0:不输入
		/// </summary>
        [DisplayName("功率是否输入")]
        [Required(ErrorMessage = "1:输入 0:不输入不允许为空!")]
        
		[DataMember]
		public Int32 Power
        {
            get;
            set;
        }
		
		/// <summary>
        /// 坡度是否输入1:输入 0:不输入
		/// </summary>
        [DisplayName("坡度是否输入")]
        [Required(ErrorMessage = "1:输入 0:不输入不允许为空!")]
        
		[DataMember]
		public Int32 Gradient
        {
            get;
            set;
        }
		
		/// <summary>
        /// 时长是否输入: 1:输入 0:不输入
		/// </summary>
        [DisplayName("时长是否输入")]
        [Required(ErrorMessage = "1:输入 0:不输入不允许为空!")]
        
		[DataMember]
		public Int32 Duration
        {
            get;
            set;
        }
		
		/// <summary>
        /// 强度是否输入 1:输入 0:不输入
		/// </summary>
        [DisplayName("强度是否输入")]
        [Required(ErrorMessage = "1:输入 0:不输入不允许为空!")]
        
		[DataMember]
		public Int32 Strength
        {
            get;
            set;
        }
		
		/// <summary>
		/// 审核标志 0：未审核 1：审核
		/// </summary>
        [DisplayName("审核标志")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public Int32 Flag
        {
            get;
            set;
        }
		
		/// <summary>
		/// 备注 
		/// </summary>
        [DisplayName("备注")]
        [StringLength(256, ErrorMessage = "请勿输入超过 256 个字!")]
        
		[DataMember]
		public String Memo
        {
            get;
            set;
        }
        /// <summary>
        /// 图片路径
        /// </summary>
        [DataMember]
        public string ImagePath { get; set; }
		
		#endregion

		#endregion 属性、变量声明
		
	    public AerobicEntity()
        {
            Code = (int)0;
            Name = string.Empty;
            Speed = (int)0;
            UnitCode = null;
            UnitName = null;
            UnitEName = null;
            Power = (int)0;
            Gradient = (int)0;
            Duration = (int)0;
            Strength = (int)0;
            Flag = (int)0;
            Memo = null;
            InUserID = (int)0;
            InDate = DateTime.Now;
            EditUserID = (int)0;
            EditDate = null;
        }

        public AerobicEntity(IDataReader dataReader):base(dataReader)
        {
            Code = Convert.IsDBNull(dataReader["Code"]) ? 0 : Convert.ToInt32(dataReader["Code"]);
            Name = Convert.IsDBNull(dataReader["Name"]) ? "" : Convert.ToString(dataReader["Name"]);
            Speed = Convert.IsDBNull(dataReader["Speed"]) ? 0 : Convert.ToInt32(dataReader["Speed"]);
            UnitCode = Convert.IsDBNull(dataReader["UnitCode"]) ? null : (int?)Convert.ToInt32(dataReader["UnitCode"]);
            UnitName = Convert.IsDBNull(dataReader["UnitName"]) ? "" : Convert.ToString(dataReader["UnitName"]);
            UnitEName = Convert.IsDBNull(dataReader["UnitEName"]) ? "" : Convert.ToString(dataReader["UnitEName"]);
            Power = Convert.IsDBNull(dataReader["Power"]) ? 0 : Convert.ToInt32(dataReader["Power"]);
            Gradient = Convert.IsDBNull(dataReader["Gradient"]) ? 0 : Convert.ToInt32(dataReader["Gradient"]);
            Duration = Convert.IsDBNull(dataReader["Duration"]) ? 0 : Convert.ToInt32(dataReader["Duration"]);
            Strength = Convert.IsDBNull(dataReader["Strength"]) ? 0 : Convert.ToInt32(dataReader["Strength"]);
            Flag = Convert.IsDBNull(dataReader["Flag"]) ? 0 : Convert.ToInt32(dataReader["Flag"]);
            Memo = Convert.IsDBNull(dataReader["Memo"]) ? "" : Convert.ToString(dataReader["Memo"]);
           
        }
	}
}
